<template>
  <div class='wy-main matching-tendering'>
    <a-row class="wy-main-title" v-if='!datailAll'>
      <a-col :span="24">
        <p class="title-p">
          <a-divider class="title-vertical" type="vertical" />
          <span class="title-span">发布物流招标信息</span>
          <a-divider class="title-divider" />
        </p>
      </a-col>
    </a-row>
    <div class="list_tab">
      <a-form :form="form" @submit="handleSubmit" class="wy-form">

        <div class="ant-row ant-form-item"  v-if='type!="info"'>
        <div class="ant-col-4 ant-form-item-label"></div>
        <div class="ant-col-20 ant-form-item-control-wrapper">
          <div class="ant-form-item-control">
            <div class="ant-title">
              <span class="title-span" style="margin-left:-50px; font-size:16px; font-weight:700; ">审核意见</span>
            </div>
             <div class="ant-radio">
              <a-radio-group v-decorator="['mode']">
                <!-- v-decorator="['mode']" -->
              <a-radio value="0">
              通过
              </a-radio>
              <a-radio value="1">
              拒绝
              </a-radio>
           </a-radio-group>
           </div>
           <div class="a-textarea">
             <a-textarea placeholder="审核意见" style="margin-top: 10px; width: 447px;height:173px;" :rows="4" />
           </div>
          </div>
        </div>
      </div>
      <div class="ant-row ant-form-item" v-if='type!="info"'>
        <div class="ant-col-4 ant-form-item-label"></div>
        <div class="ant-col-10 ant-form-item-control-wrapper">
          <div class="ant-form-item-control">
            <span class="ant-form-item-children">
              
              <a-button type="primary"  html-type="submit" >
                提交
              </a-button>
             
            </span>
          </div>
        </div>
      </div>
      </a-form>
    </div>
  </div>
</template>
<script>
  import {checkTel, checkTelNum, checkEmail} from 'utils/formValidate'
  import moment from 'moment'
  import 'moment/locale/zh-cn';
  moment.locale('zh-cn')
  export default {
    props:['datailAll'],
    
    data() {
      return {
        agreement:false,
        // 地图存起止数据
        departureData: {},
        destinationData: {},
        distance: '',
        type:'',
        fileList: [],
        formItemLayout: {
          labelCol: {
            xs: {
              span: 24
            },
            sm: {
              span: 4
            },
          },
          wrapperCol: {
            xs: {
              span: 24
            },
            sm: {
              span: 20
            },
          },
        },
      }
    },
    beforeCreate() {
      this.form = this.$form.createForm(this);
    },
    created(){
      //   console.log(this.form)
      //          if(this.datailAll){
      //   console.log(this.datailAll)
      //   let datailAll = this.datailAll;
      // setTimeout(()=>{
      //   this.form.setFieldsValue(datailAll); 
      // },0);
      // }
    },
    components: {

    },
    watch: {},

    methods: {

      //认证提交
      handleSubmit(e) {
        if(this.loading) return;
        e.preventDefault();
        this.form.validateFieldsAndScroll((err, values) => {
          if(!err) {
            this.loading = true;

            this.$put('info/logisticsTenderee/updateLogisticsTendereeBatchById', this.datailAll,true).then((r) => {
              console.log(r,8989)
              if(r.status == 200){
                this.$notification.success({
                  // message: r.data.message,
                });
                // this.$message.success('编辑成功!')
                this.form.resetFields();
               this.$emit('cancel');
              }
              this.loading = false;
            }).catch((e) => {
              console.log(e)
              this.loading = false;
            })
          }
        });
      },
    }
  }
</script>

<style lang="less" scoped>
  .matching-tendering {
    .list_tab {
      margin-top: 10px;
    }
  }
</style>